<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="shortcut icon" href="__ADDON__/xjjx/images/favicon.ico">
    <link rel="stylesheet" type="text/css" href="__ADDON__/xjjx/css/font-awesome.min.css"/>
    <link rel="stylesheet" type="text/css" href="__ADDON__/xjjx/css/sanren.css"/>
    <link rel="stylesheet" type="text/css" href="__ADDON__/xjjx/css/style.css"/>
    <script src="__ADDON__/xjjx/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__ADDON__/xjjx/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__ADDON__/xjjx/js/public.js" type="text/javascript" charset="utf-8"></script>
    <title>{cms:config name="cms.title"/}-{$site.name}</title>
    <meta name="keywords" content="{cms:config name='cms.keywords|htmlentities'/}"/>
    <meta name="description" content="{cms:config name='cms.description|htmlentities'/}"/>
</head>
<body>

<!--pc头部-->
<div class="head_pc">
    <div class="head text16">
        <div class="wrap disflex h100 flex_center">
            <ul class="nav flex1 disflex flex_center flex_lmr">
                {cms:channellist id="nav" type="top" condition="1=isnav" limit="0,4"}
                <li><a href="{$nav.url}" class="nava {if $nav->is_active}active{/if}">{$nav.name}</a></li>
                {/cms:channellist}
            </ul>
            <a href="{:addon_url('cms/channel/index',[':diyname' => 'home'])}" class="logo"><img class="disblock h100" src="__ADDON__/xjjx/images/logo.png"/></a>
            <ul class="nav flex1 disflex flex_center flex_lmr">
                {cms:channellist id="nav" type="top" condition="1=isnav" limit="4,6"}
                {if $nav.has_child}
                <li class="{if $nav->is_active}active{/if}">
                    <a href="{$nav.url}" class="nava">{$nav.name}</a>
                    <div class="navhide">
                        {cms:channellist id="sub" type="son" typeid="nav['id']" condition="1=isnav"}
                        <a href="{$sub.url}">{$sub.name}</a>
                        {/cms:channellist}
                    </div>
                </li>
                {else/}
                <li>
                    <a href="{$nav.url}" class="nava">{$nav.name}</a>
                </li>
                {/if}
                {/cms:channellist}
                <li><a href="javascript:" class="hdra"><img class="disblock" src="__ADDON__/xjjx/images/hdrico.png"/></a></li>

            </ul>
        </div>
    </div>
</div>
<!--登录弹出-->
<div class="tc login_tc">

    <div class="user_width">
        <form method="post" class=""novalidate="" id="postform3" action="{:url('index/user/login')}">
            {:token()}
        <div class="cup tc_close"><img class="disblock" src="__ADDON__/xjjx/images/close_tc.png"/></div>
        <h1 class="textcenter ititle_40 ftwt_none">登录</h1>
        <div class="usw">
            <div class="usa posrelative mt_30">
                <input class="text16" type="text" placeholder="邮箱" name="account" id="" value="" />
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="password" placeholder="密码" name="password" id="pwd_input1" value="" />
                <input class="text16" type="text" placeholder="密码" name="" id="pwd_input2" value="" />
                <i class="fa fa-eye ueye ueye_1"></i>
            </div>
            <div class="usam disflex flex_center flex_lmr text16 mt_15">
                <label class="usam_label">
                    <input type="checkbox" name="" id="" value="" />记住此账号
                </label>
                <a href="javascript:" class="text14 regClick">还没有账户？<i class="colorblue ftwt_bold">免费注册</i></a>
            </div>
            <div class="usasbm mt_30">
                <button class="text16 cup hoverop" type="submit">登录</button>
            </div>
        </div>
        </form>
    </div>

</div>
<!--注册弹出-->
<div class="tc reg_tc">
    <div class="user_width">
        <form name="form1" id="postform2"  class="form-vertical nice-validator n-default n-bootstrap" method="post" action="{:url('index/user/register')}" novalidate="novalidate">

            {:token()}
            <input type="hidden" name="invite_user_id" value="0">

            <div class="cup tc_close"><img class="disblock" src="__ADDON__/xjjx/images/close_tc.png"/></div>
        <h1 class="textcenter ititle_40 ftwt_none">注册</h1>
        <div class="usw">
            <div class="usa posrelative mt_30">
                <input class="text16" type="text" placeholder="公司" id="username" name="username" value="" />
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="text" placeholder="电话" id="mobile" name="mobile" value="" />
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="text" placeholder="邮箱" name="email" id="email" value="" />
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="text" placeholder="邮箱验证码" name="captcha" id="email2" value="" />
                <span class="usacode hoverop yxyz "  type="button" data-url="{:url('api/ems/send')}" data-type="email">获取</span>
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="password" placeholder="密码" id="password" name="password" value="" />
            </div>
            <div class="usa posrelative mt_30">
                <input class="text16" type="password" placeholder="重新输入密码" id="password2" name="password" value="" />
            </div>
            <div class="usasbm mt_30">
                <button class="text16 cup hoverop btn1" type="button" id="register">提交</button>
            </div>
        </div>
        </form>
    </div>





</div>
<!--wap头部-->
<div class="head_wap">
    <div class="whead clearfix">
        <a href="index.html" class="wlogo fl"><img src="__ADDON__/xjjx/images/logo.png"/></a>
        <i class="navicon"><em></em></i>.
        <i class="usericon"><img src="__ADDON__/xjjx/images/hdrico.png"/></i>
    </div>
    <div class="wpnvbg"></div>
    <div class="wapnav">
        <div class="wapnava clearfix">
            <ul>
                {cms:channellist id="nav" type="top" condition="1=isnav"}
                {if $nav.has_child}
                <li>
                    <a  class="wapprda">{$nav.name}<i class="fa fa-angle-right"></i></a>
                    <div class="wpheadhide">
                        {cms:channellist id="sub" type="son" typeid="nav['id']" condition="1=isnav"}
                        <a href="{$sub.url}">{$sub.name}</a>
                        {/cms:channellist}
                    </div>
                </li>
                {else/}
                <li><a href="{$nav.url}" class="wapprda">{$nav.name}</a></li>
                {/if}
                {/cms:channellist}
            </ul>
        </div>
    </div>
    <div class="waphd_height"></div>
</div>


{__CONTENT__}

<div class="right">
    <div class="rta">
        <a href="javascript:" class="rta_a" id="gotop"><img class="disblock w100" src="__ADDON__/xjjx/images/gotop.png"/></a>
    </div>
</div>
<div class="foot">
    <div class="ft">
        <div class="wrap disflex flex_lmr wap_disblock">
            <a href="" class="flogo" ><img src="__ADDON__/xjjx/images/wlo.png" style="height: 80px;"/></a>
            <div class="fta">
                <h3 class="text20 ftwt_none">联系我们</h3>
                <ul class="txt text16 ftwt_100 mt_15">
                    <li>地址：{$site.add}</li>
                    <li>邮编：{$site.youbian}</li>
                    <li style="display: flex;" 	class="flex_lr_centermt"><div>邮箱</div>：<div>{$site.ema}</div></li>
                    <li style="display: flex;" class="flex_lr_centermt"><div>电话</div>：<div>{$site.pho}</div></li>
                </ul>
            </div>
            <div class="fta">
                <h3 class="text20 ftwt_none">友情链接</h3>
                <ul class="txt text16 ftwt_100 mt_15">




                    {foreach name="$site['lianjie']" item="vo" }
                    <li><a href="{$vo}">   {$key}</a></li>
                    {/foreach}

                </ul>
            </div>
            <div class="ftr"><img width="170" src="__ADDON__/xjjx/images/ewm.png"/></div>
        </div>
    </div>
    <div class="fb">
        <div class="wrap">
            <span>版权所有©2022 建筑机械杂志社</span>
            <a href="http://beian.miit.gov.cn/" class="ml20">{$site.beian}</a>
        </div>
    </div>
</div>

{__SCRIPT__}

<script>
    //验证码

    <script type="text/javascript" src="__CDN__/assets/libs/bootstrap/dist/js/bootstrap.min.js?v={$site.version}"></script>
<script type="text/javascript" src="__CDN__/assets/libs/fastadmin-layer/dist/layer.js?v={$site.version}"></script>
<script type="text/javascript" src="__CDN__/assets/libs/art-template/dist/template-native.js?v={$site.version}"></script>
<script type="text/javascript" src="__ADDON__/js/jquery.autocomplete.js?v={$site.version}"></script>
<script type="text/javascript" src="__ADDON__/js/swiper.min.js?v={$site.version}"></script>
<script type="text/javascript" src="__ADDON__/js/share.min.js?v={$site.version}"></script>
<script type="text/javascript" src="__ADDON__/js/cms.js?v={$site.version}"></script>
<script>
    //验证码
    var counts = 60;

    function settime(val) {
        // console.log($(val).data('event'))
        // var event='#'+$(val).data('id')
        // var flag=sendemail($(val).data('event'),$(event).val())
        // console.log(flag)
        // if (flag==true) {
        console.log(counts)
        if (counts == 0) {
            $(".yxyz").attr("disabled", false);
            val.value = "获取验证码";
            $(".yxyz").text(val.value);
            counts = 60;
            return false;
        } else {
            $(".yxyz").attr("disabled", true);
            val.value = "重新发送（" + counts + "）";
            $(".yxyz").text(val.value);
            counts--;
        }
        setTimeout(function () {
            settime(val);
        }, 1000);
        // }
    }


    $(".yxyz").on('click',function () {
        if (counts!=60){
            return false
        }
        var userinfo = {
            // "email": $("input[name='email']").val()
            "email": $("#email").val(),
            // "email": email,
            // "event":event
        }
        var email=$("#email").val()
        console.log(email)
        var reg2 = /^[a-zA-Z0-9]+@[a-z0-9]{2,5}\.[a-z]{2,3}(\.[a-z]{2,3})?$/;
        var result2 = reg2.test(email);

        if (!result2){
            alert("请输入正确邮箱");
            return false;
        }
        console.log(userinfo);
        $.ajax({
            url: "{:addon_url('cms/api.ems/send')}",
            // url: "{:url('index/user/send')}",
            data: userinfo,
            type: 'post',
            dataType: 'json',
            success: function(data) {
                if (data.code == 1) {

                    settime(this);
                    alert("邮箱验证码发送成功，60S后可以再次发送。")
                    return true;
                } else {
                    alert(data.msg);
                    console.log("失败")
                    return false;
                }
            },
            error: function() {
                alert("请求失败");
                return false;
            }
        })
    })
    var isloading =false;
    // $(".btn1").on("click", function() {
    //     if (isloading) {
    //         return;
    //     }
    //     var targetUrl = $("#register-form").attr("action");
    //     var data = $("#register-form").serialize();
    //     if (!check($("#register-form"))) {
    //         return;
    //     }
    //
    //     isloading = true;
    //     $.ajax({
    //         type:'post',
    //         url:'/xjjx/public/index/user/register',
    //         cache: false,
    //         data:data,  //重点必须为一个变量如：data
    //         //dataType:'json',
    //         success:function(data){
    //             isloading=false
    //             if(data.code==1){
    //                 window._agl && window._agl.push(['track', ['success', { t: 3 }]]);
    //                 alert("提交成功，我们会尽快与您联系！");
    //             }else{
    //                 alert('请勿重复操作');
    //                 alert(data.msg);
    //             }
    //         },
    //         error:function(){
    //             isloading=false;
    //             alert("请求失败")
    //         }
    //     })
    //     // console.log(data.email)
    // });

    $("#register").on("click",function (){
        if (!check($("#postform2"))) {
            return;
        }
        CMS.api.ajax({
            url: $("#postform2").attr("action"),
            data: $("#postform2").serialize()
        },function (){
            setTimeout(function () {
                window.location.reload();
            },2000)
        });


    })
</script>
<script>
    function check(theform2,sp){

        var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
        var username = $(theform2).find("#username").val();
        var mobile = $(theform2).find("#mobile").val();

        var password = $(theform2).find("#password").val();
        var password2 = $(theform2).find("#password2").val();
        var reg1 = /^1(3|4|5|7|8)\d{9}$/;

        var result = reg1.test(mobile);

        if (username== ""){
            alert("请输入公司名称");
            // theform2.other.focus();
            return false;
        }
        if (mobile== ""){
            alert("请输入您的电话");
            return false;
        }
        if(!result){
            alert("请输入正确的手机号");
            return false;
        }

        if (password == ""){
            alert("请输入密码");
            return false;
        }
        if (password2 == ""){
            alert("请再一次输入密码");
            return false;
        }
        if (password != password2){
            alert("两次输入的密码不正确");
            return false;
        }

        return true;
    }
</script>

</body>
</html>
